import request from "@/api/request";

export function Login(params:LoginForm) {
  return request({
    url: "/login",
    method: "post",
    data: params,
    headers: {
      isToken: false,
    },
  });
}

/**
 * 获取验证码
 * @returns 验证码
 */
export function obtainVerifyCode() {
  return request({
    url: "/obtainVerifyCode",
    method: "get",
    headers: {
      isToken: false,
    },
  });
}

/**
 * 获取用户信息
 * @returns 用户信息
 */
export function getUserInfo(){
  return request({
    url: "/getUserInfo",
    method: "get",
  });
}

/**
 * 获取菜单列表
 * @returns 菜单列表
 */
export function getMenuList(){
  return request({
    url: "/getMenuList",
    method: "get",
  });
}

/**
 * 退出登录
 * @returns 退出登录
 */
export function logout() {
  return request({
    url: "/logout",
    method: "post",
  });
}


export interface LoginForm {
    username: string;
    password: string;
    code: string;
    uuid: string;
}